package cn.edu.just.firstjavaapp.l12;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class CalendarDemo {
    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();//工厂方法：创建一个对象的方法
        calendar.add(Calendar.MONTH,10);
        System.out.println(calendar);
        Date date = calendar.getTime();
        System.out.println("date:"+date.getTime());
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        System.out.println(sdf.format(date));
        Calendar nationalDay= Calendar.getInstance();
        nationalDay.set(2025,9,1);

    }
}
